package com.uwlaser.cut;

import lombok.SneakyThrows;
import org.apache.poi.ss.formula.functions.T;
import org.aspectj.lang.ProceedingJoinPoint;

import java.lang.reflect.Method;

/**
 * @author LiuZhiHui
 * @version 1.0
 * @description: TODO
 * @date 2022/8/17 10:47
 */
public interface BaseMethodCut {

    /**
     * @author LiuZhiHui
     * @description: TODO
     * @param: tClass 反射的类
     * @param: methodName 反射的方法名称
     * @param: params 反射方法的参数
     * @return: java.lang.reflect.Method
     * @date: 2022/8/19 16:59
     */
    @SneakyThrows
    default <T> Method getMethodClass(Class<T> tClass, String methodName,Class<?>... paramsType) {
        return tClass.getMethod(methodName,paramsType);
    }

    /** 返回方法类型
     * @author LiuZhiHui
     * @description: TODO
     * @param:
     * @return: java.lang.reflect.Method
     * @date: 2022/8/17 13:45
     */
    Method getMethodClass();

    /** 前置方法
     * @author LiuZhiHui
     * @description: TODO
     * @param:
     * @return: joinPoint
     * @date: 2022/8/17 11:50
     */
    void before(ProceedingJoinPoint joinPoint) throws Exception;

    /** 后缀方法
     * @author LiuZhiHui
     * @description: TODO
     * @param: joinPoint
     * @return: void
     * @date: 2022/8/17 11:50
     */
    void after(ProceedingJoinPoint joinPoint,Object returnValue) throws Exception;

}
